package com.yxhl.zoume.core.specialcar.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.yxhl.zoume.R;
import com.yxhl.zoume.common.ui.activity.base.BaseActivityWithToolBar;
import com.yxhl.zoume.core.specialcar.fragment.SpecialCarFeeDetailFragment;
import com.yxhl.zoume.core.specialcar.model.SpecialCarFeeDetailModel;

/**
 * Created by vhawk on 11/17/16.
 */

public class SpecialCarFeeDetailActivity extends BaseActivityWithToolBar {

    private static final String KEY_SPECIAL_CAR_FEE_DETAIL = "SPECIAL_CAR_FEE_DETAIL";
    private SpecialCarFeeDetailModel specialCarFeeDetailModel;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setToolbarTitle("行程费用明细");
        handlerExtraParam();
        addFragment(R.id.special_car_fee_detail_container, SpecialCarFeeDetailFragment.newInstance(specialCarFeeDetailModel));
    }

    private void handlerExtraParam() {
        specialCarFeeDetailModel = (SpecialCarFeeDetailModel) getIntent().getSerializableExtra(KEY_SPECIAL_CAR_FEE_DETAIL);
    }

    @Override
    protected void onHeaderLeftClick(View view) {
        finish();
    }

    @Override
    protected void onHeaderRightClick(View view) {

    }

    @Override
    protected int getLayoutResId() {
        return R.layout.activity_special_car_fee_detail;
    }

    @Override
    protected void initializeInjector() {

    }

    public static Intent getCallingIntent(Activity activity, SpecialCarFeeDetailModel specialCarFeeDetailModel) {
        Intent intent = new Intent(activity, SpecialCarFeeDetailActivity.class);
        intent.putExtra(KEY_SPECIAL_CAR_FEE_DETAIL, specialCarFeeDetailModel);
        return intent;
    }
}
